#delimit ;
set more off;


/*NOTE: For a Mac, file path names use a forward slash (/) but for 
PC's they require a backward slash (\). Make these changes below 
if necessary depending on your computer type. 
*/

*Dropbox paths by user;
if c(username)=="shayaksarkar" {;
	local path "/Users/shayaksarkar/Desktop/ReStat_Data_Publication";
};

/*TABLE A5*/;

cd `path';

use "`path'/dta/final_agentsurvey.dta", clear;


*set file to which all putexcel commands will refer;
putexcel set "`path'/out/tableA5.xls", replace;

*********;
*PANEL A;
*********;

ttest VigNeedTerm_Term==VigNeedWhole_Term;
di r(mu_1);
putexcel C8=(r(mu_1));

di r(mu_2);
putexcel G8=(r(mu_2));

di r(p);
putexcel D9=(r(p));

ttest RPNeedTerm_Term==RPNeedWhole_Term;
di r(mu_1);
putexcel C12=(r(mu_1));

di r(mu_2);
putexcel G12=(r(mu_2));

di r(p);
putexcel D13=(r(p));

putexcel A2=("Appendix 5 - Table") B7=("Vignette") B8=("Recommends Term")
B9=("Paired t-test two sided p-value") C6=("Needs Term") G6=("Needs Whole")
B12=("Vignette") B13=("Recommends Term") B14=("Paired t-test two sided p-value");


*********;
*PANEL B;
*********;
 
tabout Whole_PartFirst Whole_ExcFirst Whole_PartFinal Whole_ExcLast  using "`path'/out/tableA5panelb.xls", replace
oneway;

*********;
*PANEL C;
*********;

tabout Ask_Age Ask_MS Ask_YD Ask_Salary Ask_Savings CT_1 CT_2 CT_3 CT_4 CT_5
using "`path'/out/tableA5panelc.xls", replace oneway;








